﻿using QDSpider.database;
using QDSpider.Models;

namespace QDSpider.manager
{
    public static class ArticleSettingManager
    {
        public static void Insert(ArticleSetting set)
        {
            using (var db = new S003Database())
            {
                 db.Insert(set);
            }
        }

        public static void Update(ArticleSetting set)
        {
            using (var db = new S003Database())
            {
                db.Update(set);
            }
        }

        public static ArticleSetting Get(int id)
        {
            using (var db = new S003Database())
            {
                return db.SingleOrDefault<ArticleSetting>(id);
            }
        }

        public static  ArticleSetting GetByUserId(int userid)
        {
            using (var db = new S003Database())
            {
                return db.SingleOrDefault<ArticleSetting>("select  * from dyb_ArticleSetting where userid=@0", userid);
            }
        }
    }
}
